extends Control

@onready var enemy = get_tree().get_first_node_in_group("Enemy")

func _ready():
	await get_tree().create_timer(1).timeout
	%EnemyHPBar.max_value = enemy.get_child(0).Health
	%EnemyHPBar.value = enemy.get_child(0).Health
	

func _process(_delta):
	%EnemyHPBar.value = enemy.get_child(0).Health
	%EnemyHPTxt.text = str(enemy.get_child(0).Health) + "/" + str(enemy.get_child(0).MaxHealth) 
	if enemy.get_child(0).Health <= 0:
		%EnemyHPTxt.text = "0/" + str(enemy.get_child(0).MaxHealth) 
	%EnemyInfo.text = str(enemy.get_child(0).name) + " LV." + str(enemy.get_child(0).Level)
	
